<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="utf-8">
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">	
        <meta name="apple-mobile-web-app-capable" content="yes">	
        <meta name="format-detection" content="telephone=no">
        <title>福轨-OA办公系统<?php if($title != null): ?>-<?php echo ($title); endif; ?></title>
        <meta name="descption" content="<?php echo ($web["descption"]); ?>" />
        <meta name="keywords" content="<?php echo ($web["keywords"]); ?> " />
    <link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />

<link rel="stylesheet" type="text/css" href="/Public/Admin/common/layui/css/layui.css" media="all"/>
<link rel="stylesheet" type="text/css" href="/Public/Admin/common/bootstrap/css/bootstrap.css" media="all"/>
<link rel="stylesheet" type="text/css" href="/Public/Admin/common/global.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/adminstyle.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css" />

<script type="text/javascript" src="/Public/Admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/Public/Admin/common/layui/layui.js"></script>
<script type="text/javascript" src="/Public/Admin/js/larry.js"></script>
<script type="text/javascript" src="/Public/Admin/js/index.js"></script>
<script type="text/javascript" src="/Public/static/layer/layer.js" ></script>

<!--日历插件-->
<!--<link rel="stylesheet" type="text/css" href="/Public/static/fullcalendar/css/fullcalendar.css">
<link rel="stylesheet" type="text/css" href="/Public/static/fullcalendar/css/jquery-ui.css">
<script src='/Public/static/fullcalendar/js/fullcalendar.min.js'></script>  -->
<link rel="stylesheet" type="text/css" href="/Public/static/datetimepicker-master/jquery.datetimepicker.css">
<script type="text/javascript" src="/Public/static/datetimepicker-master/jquery.datetimepicker.js" ></script>

<!--自定义 css-->
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/page.css">

<!--自定义 js-->
<!--<script type="text/javascript" src="/Public/static/js/formcheck.js" ></script>-->  
<script type="text/javascript" src="/Public/Admin/js/init.js" ></script>







    
    <!--文件上传-->
    <script type="text/javascript" src="/Public/Cropper/js/ajaxfileupload.js" ></script>
    <style>
    </style>

</head>
<body class="mian-page">
    <div class="layui-layout layui-layout-admin" id="layui_layout">
        <!-- 顶部区域 -->
<div class="layui-header header header-demo">
    <div class="layui-main">
        <!-- logo区域 -->
        <div class="admin-logo-box">
            <a class="logo" href="javascript:;" title="logo">OA办公平台</a>
<!--            <div class="larry-side-menu">
                <i class="fa fa-bars" aria-hidden="true"></i>
            </div>-->
            <div class="larry-side-menu">
                <i class="" aria-hidden="true">
                    <img src="/Public/Admin/images/menuBar.png" />
                </i>
            </div>
            <div class="fullscreen">
                <img src="/Public/Admin/images/fullScreen.png" onclick="fullScreen()" />
            </div>
        </div>
        <!-- 右侧导航 -->
        <ul class="layui-nav larry-header-item">
            <li class="layui-nav-item">
                <a href="javascript:;" style="padding-right:25px;">
                    <img class="headImg" src="<?php if($userinfo[head] != null): echo ($userinfo["head"]); elseif($userinfo[sex] == 1): ?>/Public/Admin/images/man.png<?php else: ?>/Public/Admin/images/woman.png<?php endif; ?>">
                    <cite><?php echo ($userinfo["user_name"]); ?></cite>
                    <!--<span class="layui-nav-more" style="right:17px;"></span>-->
                </a>
<!--                <dl class="layui-nav-child">
                    <dd>
                        <a class="exit pointer" data-url="<?php echo U('Login/logout');?>">退出</a>
                    </dd>
                </dl>-->
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;" style="padding-right:25px;">
                    <i class="layui-icon"><img src="/Public/Admin/images/user.png" /></i>
                    <span class="layui-badge-dot"><?php echo ($attendCount); ?></span>
                    <span class="layui-nav-more" style="right:10px;"></span>
                </a>
                <div class="layui-nav-child stateBox" id="stateBox">
                    <div class="search">
                        <i class="layui-icon layui-icon-notice"><img src="/Public/Admin/images/searchiIcon.png" /></i>
                        <input type="text" placeholder="搜索人员" class="searchUser" value="" data-url="<?php echo U(searchUser);?>"/>
                    </div>
                    <ul>
                        <li class="item item-hide" state="hide">
                            <a>
                                <span>外出人员</span>
                                <label class="color1"><?php echo ($outCount); ?></label>
                                <em class="arrow"></em>
                            </a>
                            <dl>
                                <?php if(is_array($outList)): foreach($outList as $key=>$out): ?><dd>
                                        <img src="<?php echo ($out["head"]); ?>" />
                                        <span><?php echo (getChineseName($out["user_id"])); ?></span>
                                    </dd><?php endforeach; endif; ?>
                            </dl>
                        </li>
                        <li class="item item-hide" state="hide">
                            <a>
                                <span>出差人员</span>
                                <label class="color3"><?php echo ($evectionCount); ?></label>
                                <em class="arrow"></em>
                            </a>
                            <dl>
                                <?php if(is_array($evectionList)): foreach($evectionList as $key=>$evection): ?><dd>
                                        <img src="<?php echo ($evection["head"]); ?>" />
                                        <span><?php echo (getChineseName($evection["user_id"])); ?></span>
                                    </dd><?php endforeach; endif; ?>
                            </dl>
                        </li>
                        <li class="item item-hide" state="hide">
                            <a>
                                <span>请假人员</span>
                                <label class="color2"><?php echo ($leaveCount); ?></label>
                                <em class="arrow"></em>
                            </a>
                            <dl>
                                <?php if(is_array($leaveList)): foreach($leaveList as $key=>$leave): ?><dd>
                                        <img src="<?php echo ($leave["head"]); ?>" />
                                        <span><?php echo (getChineseName($leave["user_id"])); ?></span>
                                    </dd><?php endforeach; endif; ?>
                            </dl>
                        </li>
                    </ul>
                </div>
            </li>
        </ul>
    </div>
</div>
<script>
    $(initLogin());
    
    $("#stateBox>ul").height(window.innerHeight - 135);
    $(document).on("click", "#stateBox li>a", function () {
        var state = $(this).parents("li").attr("state");
        if (state == "hide") {
            $(this).parents("li").attr("state", "show");
            $(this).parents("li").addClass("item-show").removeClass("item-hide");
        } else if (state == "show") {
            $(this).parents("li").attr("state", "hide");
            $(this).parents("li").addClass("item-hide").removeClass("item-show");
        }
    })

    
    //全屏
    function fullScreen() {
        var el = document.documentElement;
        var rfs = el.requestFullScreen || el.webkitRequestFullScreen || 
        el.mozRequestFullScreen || el.msRequestFullScreen;
        if(typeof rfs != "undefined" && rfs) {
            rfs.call(el);
        } else if(typeof window.ActiveXObject != "undefined") {
    //for IE，这里其实就是模拟了按下键盘的F11，使浏览器全屏
            var wscript = new ActiveXObject("WScript.Shell");
            if(wscript != null) {
                    wscript.SendKeys("{F11}");
            }
        }
    }
</script>


        <!-- 左侧侧边导航开始 -->
<div class="layui-side layui-side-bg layui-larry-side" id="larry-side">
    <div class="layui-side-scroll" id="larry-nav-side" lay-filter="side">

        <!-- 左侧菜单 -->
        <ul class="layui-nav layui-nav-tree">
            <li class="layui-nav-item layui-this">
                <a href="<?php echo U('Index/index');?>">
                    <i class="iconfont homeIcon"></i>
                    <span>首页</span>
                </a>
            </li>
            <!-- 个人信息 -->
            <?php if(is_array($userMenus)): foreach($userMenus as $key=>$menu): ?><li class="layui-nav-item layui-child">
                    <a href="javascript:;" data-url="<?php echo ($menu["url"]); ?>" class="parentCate">
                        <i class="iconfont leftIcon<?php echo ($key+1); ?>" ></i>
                        <span><?php echo ($menu["name"]); ?></span>
                        <em class="layui-nav-more"></em>
                    </a>
                    <dl class="layui-nav-child">
                        <?php if(is_array($menu["child"])): foreach($menu["child"] as $key=>$child): ?><dd>
                                <a href="<?php if($child[param] != null): ?>/index.php/Home/<?php echo ($child["url"]); ?>&<?php echo ($child["param"]); else: ?>/index.php/Home/<?php echo ($child["url"]); endif; ?>" data-url="/index.php/Home/<?php echo ($child["url"]); ?>">
                                    <i class="iconfont" style="font-size:10px;">></i>
                                    <span style="font-size:13px;"><?php echo ($child["name"]); ?></span>
                                </a>
                            </dd><?php endforeach; endif; ?>
                    </dl>
                </li><?php endforeach; endif; ?>
        </ul>
    </div>
</div>
<!-- 左侧侧边导航结束 -->

        <!-- 右侧主体内容 -->
        <input type="hidden" id="loginUser" value="<?php echo ($user); ?>">
        <div class="layui-body" id="larry-body" style="bottom: 0;border-left: solid 2px #2299ee;">
            <div class="layui-tab layui-tab-card larry-tab-box" id="larry-tab" lay-filter="demo" lay-allowclose="true">
                <div class="go-left key-press pressKey" id="titleLeft" title="滚动至最右侧"><i class="larry-icon larry-weibiaoti6-copy"></i> </div>
                <ul class="layui-tab-title" style="display: none;">
                    <li class="layui-this" id="admin-home"><i class="iconfont icon-diannao1"></i><em>后台首页</em></li>
                </ul>
                <div class="go-right key-press pressKey" id="titleRight" title="滚动至最左侧"><i class="larry-icon larry-right"></i></div> 
                <ul class="layui-nav closeBox" style="display: none;">
                    <li class="layui-nav-item">
                        <a href="javascript:;"><i class="iconfont icon-caozuo"></i> 页面操作</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;" class="refresh refreshThis"><i class="layui-icon">&#x1002;</i> 刷新当前</a></dd>
                            <dd><a href="javascript:;" class="closePageOther"><i class="iconfont icon-prohibit"></i> 关闭其他</a></dd>
                            <dd><a href="javascript:;" class="closePageAll"><i class="iconfont icon-guanbi"></i> 关闭全部</a></dd>
                        </dl>
                    </li>
                </ul>
                <div class="layui-tab-content" style="min-height: 150px; ">
                    <div class="layui-tab-item layui-show" id="main">
                         
    <section class="larry-wrapper" style="padding-top:20px">
        <div class="row pege-storage" id="pege-storage">
            <div class="col-lg-12 col-sm-12">
                <div class="layui-row btnWrap">
                    <button class="layui-btn layui-btn-normal importBtn" id="upload">导入Excel</button>
                    <a class="layui-btn downloadBtn" href="/Public/examples.xlsx" download="物品入库表.xlsx">下载Excel模板</a>
                    <input type="file" id="inputImage" name='imgfile' style="display:none">
                    <input type="hidden" id="filename" name="uploads" value="<?php echo ($uploads[0]["uploadsName"]); ?>">
                    <input type="hidden" id="fileurl" name="uploads_url" value="<?php echo ($uploads[0]["uploadsUrl"]); ?>">
                </div>
                <form class="submitForm">
                    <div class="layui-row">
                        <div class="layui-inline">
                            <label class="layui-form-label">类别：</label>
                            <div class="layui-input-inline">
                                <select class="layui-input search_input" name="type" style="min-width: 120px;">
                                    <?php if(is_array($cates)): foreach($cates as $key=>$cate): ?><option value="<?php echo ($cate["id"]); ?>"><?php echo ($cate["name"]); ?></option><?php endforeach; endif; ?>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">凭证号：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="number" placeholder="为空默认生成" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">时间：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="create_time" placeholder="为空默认当前时间" class="layui-input datepickerInput">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <a class="layui-btn layui-btn-normal categoryBtn" data-ctrl="goods">新增类别</a>
                        </div>
                    </div>
                    <div class="layui-row">
                        <table class="layui-table setTabBg" id="storageTab" lay-skin="line">
                            <colgroup>
                                <col width="20%" />
                                <col width="20%" />
                                <col width="10%" />
                                <col width="10%" />
                                <col width="12%" />
                                <col width="20%" />
                                <col width="8%" />
                            </colgroup>
                            <thead>
                                <tr>
                                    <th>物品名称</th>
                                    <th>规格型号</th>
                                    <th>数量</th>
                                    <th>单位</th>
                                    <th>合计金额</th>
                                    <th>备注</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td><input type="text" class="layui-input goods-name" name="name[]"></td>
                                    <td><input type="text" class="layui-input" name="model[]"></td>
                                    <td><input type="text" class="layui-input count" name="count[]"></td>
                                    <td><input type="text" class="layui-input" name="unit[]"></td>
                                    <td><input type="text" class="layui-input price" name="price[]"></td>
                                    <td><input type="text" class="layui-input" name="remark[]"></td>
                                    <td>
                                        <img src="/Public/Admin/images/add.png" class="pointer addBtn"/>
                                        <img src="/Public/Admin/images/del.png" class="pointer delBtn"/>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <a class="layui-btn submitBtn ajax-post btn-submit" id="aaa" data-url="<?php echo U('putGoods');?>" data-form="">提交</a>
                    </div>
                </form>
            </div>
        </div>
        <input type="hidden" id="backUrl" value="<?php echo U('index');?>">
    </section>

                    </div>
                </div>
            </div>
        </div>
        <!-- 底部区域 
        <div class="layui-footer layui-larry-foot" id="larry-footer">
            <div class="layui-mian">  
                <p class="p-admin">
                    <span>2017 &copy;</span>
                    版权所有
                </p>
            </div>
        </div>-->
    </div>
    <div class="lock-screen" style="display: none;">
        <div id="locker" class="lock-wrapper">
            <div id="time"></div>
            <div class="lock-box center">
                <!--<img src="images/userimg.jpg" alt="">-->
                <h1>admin</h1>
                <duv class="form-group col-lg-12">
                    <input type="password" placeholder='锁屏状态，请输入密码解锁' id="lock_password" class="form-control lock-input" autofocus name="lock_password">
                    <button id="unlock" class="btn btn-lock">解锁</button>
                </duv>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="/Public/Admin/js/goods.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js" ></script>
    <script type="text/javascript">
        $(initAddCate());
        $(initGoods());
        $(dateTime(0));
        $(initUploadGoods("<?php echo U(CONTROLLER_NAME.'/upload');?>"));
        layui.use(['jquery', 'layer', 'element'], function () {
            window.jQuery = window.$ = layui.jquery;
            window.layer = layui.layer;
            window.element = layui.element();
        });

        //检查表单
        $('.ajax-post').on('click', function () {
            var flag = true;
            $('body').find('.goods-name').each(function(){
                if($(this).val() == ''){
                    layer.msg('请填写物品名称');
                    flag = false;
                }
            })
            $('body').find('.count').each(function(){
                if($(this).val() == ''){
                    layer.msg('请填写物品数量');
                    flag = false;
                }
            })
            $('body').find('.price').each(function(){
                if($(this).val() == ''){
                    layer.msg('请填写物品金额');
                    flag = false;
                }
            })
            
            
            if (flag == false) {
                $(this).removeClass('btn-submit');
            } else {
                $(this).addClass('btn-submit');
            }
        })

    </script>    
    <script type="text/javascript" src="/Public/Admin/js/common.js"></script>


</body>
</html>